3.52 \(\int \frac{\cot (c+d x)}{a+i a \tan (c+d x)} \, dx\)

Optimal. Leaf size=47 \[ \frac{1}{2 d (a+i a \tan (c+d x))}+\frac{\log (\sin (c+d x))}{a d}-\frac{i x}{2 a} \]

[Out]

((-I/2)*x)/a + Log[Sin[c + d*x]]/(a*d) + 1/(2*d*(a + I*a*Tan[c + d*x]))

________________________________________________________________________________________

Rubi [A]  time = 0.056771, antiderivative size = 47, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 22, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {3551, 3479, 8, 3475} \[ \frac{1}{2 d (a+i a \tan (c+d x))}+\frac{\log (\sin (c+d x))}{a d}-\frac{i x}{2 a} \]

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]/(a + I*a*Tan[c + d*x]),x]

[Out]

((-I/2)*x)/a + Log[Sin[c + d*x]]/(a*d) + 1/(2*d*(a + I*a*Tan[c + d*x]))

Rule 3551

Int[1/(((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])), x_Symbol] :> Dist[b/(
b*c - a*d), Int[1/(a + b*Tan[e + f*x]), x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*Tan[e + f*x]), x], x] /; Fre
eQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0]

Rule 3479

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*(a + b*Tan[c + d*x])^n)/(2*b*d*n), x] +
Dist[1/(2*a), Int[(a + b*Tan[c + d*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin{align*} \int \frac{\cot (c+d x)}{a+i a \tan (c+d x)} \, dx &=-\left (i \int \frac{1}{a+i a \tan (c+d x)} \, dx\right )+\frac{\int \cot (c+d x) \, dx}{a}\\ &=\frac{\log (\sin (c+d x))}{a d}+\frac{1}{2 d (a+i a \tan (c+d x))}-\frac{i \int 1 \, dx}{2 a}\\ &=-\frac{i x}{2 a}+\frac{\log (\sin (c+d x))}{a d}+\frac{1}{2 d (a+i a \tan (c+d x))}\\ \end{align*}

Mathematica [A]  time = 0.308633, size = 87, normalized size = 1.85 \[ \frac{\tan ^{-1}(\tan (d x)) (-4-4 i \tan (c+d x))-2 i \log \left (\sin ^2(c+d x)\right )+\tan (c+d x) \left (2 \log \left (\sin ^2(c+d x)\right )+2 i d x-1\right )+2 d x-i}{4 a d (\tan (c+d x)-i)} \]

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]/(a + I*a*Tan[c + d*x]),x]

[Out]

(-I + 2*d*x - (2*I)*Log[Sin[c + d*x]^2] + ArcTan[Tan[d*x]]*(-4 - (4*I)*Tan[c + d*x]) + (-1 + (2*I)*d*x + 2*Log
[Sin[c + d*x]^2])*Tan[c + d*x])/(4*a*d*(-I + Tan[c + d*x]))

________________________________________________________________________________________

Maple [A]  time = 0.067, size = 72, normalized size = 1.5 \begin{align*}{\frac{-{\frac{i}{2}}}{ad \left ( \tan \left ( dx+c \right ) -i \right ) }}-{\frac{3\,\ln \left ( \tan \left ( dx+c \right ) -i \right ) }{4\,ad}}-{\frac{\ln \left ( \tan \left ( dx+c \right ) +i \right ) }{4\,ad}}+{\frac{\ln \left ( \tan \left ( dx+c \right ) \right ) }{ad}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)/(a+I*a*tan(d*x+c)),x)

[Out]

-1/2*I/d/a/(tan(d*x+c)-I)-3/4/d/a*ln(tan(d*x+c)-I)-1/4/d/a*ln(tan(d*x+c)+I)+1/a/d*ln(tan(d*x+c))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="maxima")

[Out]

Exception raised: RuntimeError

________________________________________________________________________________________

Fricas [A]  time = 2.24639, size = 162, normalized size = 3.45 \begin{align*} \frac{{\left (-6 i \, d x e^{\left (2 i \, d x + 2 i \, c\right )} + 4 \, e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} - 1\right ) + 1\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{4 \, a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(-6*I*d*x*e^(2*I*d*x + 2*I*c) + 4*e^(2*I*d*x + 2*I*c)*log(e^(2*I*d*x + 2*I*c) - 1) + 1)*e^(-2*I*d*x - 2*I*
c)/(a*d)

________________________________________________________________________________________

Sympy [A]  time = 0.635395, size = 92, normalized size = 1.96 \begin{align*} \begin{cases} \frac{e^{- 2 i c} e^{- 2 i d x}}{4 a d} & \text{for}\: 4 a d e^{2 i c} \neq 0 \\x \left (- \frac{\left (3 i e^{2 i c} + i\right ) e^{- 2 i c}}{2 a} + \frac{3 i}{2 a}\right ) & \text{otherwise} \end{cases} - \frac{3 i x}{2 a} + \frac{\log{\left (e^{2 i d x} - e^{- 2 i c} \right )}}{a d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+I*a*tan(d*x+c)),x)

[Out]

Piecewise((exp(-2*I*c)*exp(-2*I*d*x)/(4*a*d), Ne(4*a*d*exp(2*I*c), 0)), (x*(-(3*I*exp(2*I*c) + I)*exp(-2*I*c)/
(2*a) + 3*I/(2*a)), True)) - 3*I*x/(2*a) + log(exp(2*I*d*x) - exp(-2*I*c))/(a*d)

________________________________________________________________________________________

Giac [A]  time = 1.29727, size = 99, normalized size = 2.11 \begin{align*} -\frac{\frac{3 \, \log \left (\tan \left (d x + c\right ) - i\right )}{a} + \frac{\log \left (i \, \tan \left (d x + c\right ) - 1\right )}{a} - \frac{4 \, \log \left ({\left | \tan \left (d x + c\right ) \right |}\right )}{a} - \frac{3 \, \tan \left (d x + c\right ) - 5 i}{a{\left (\tan \left (d x + c\right ) - i\right )}}}{4 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)/(a+I*a*tan(d*x+c)),x, algorithm="giac")

[Out]

-1/4*(3*log(tan(d*x + c) - I)/a + log(I*tan(d*x + c) - 1)/a - 4*log(abs(tan(d*x + c)))/a - (3*tan(d*x + c) - 5
*I)/(a*(tan(d*x + c) - I)))/d